package com.hsylient.redis.controller;

import com.hsylient.redis.service.RedisClusterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisClusterController {

    @Autowired
    private RedisClusterService redisClusterService;

    @GetMapping("/test-redis-cluster")
    public String testRedisCluster() {
        try {
            redisClusterService.testCluster();
            return "Redis 集群验证成功！";
        } catch (Exception e) {
            e.printStackTrace();
            return "Redis 集群验证失败！错误信息：" + e.getMessage();
        }
    }
}
